package com.ruoyi.common.domain.knowledge;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.domain.doctor.Doctor;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 文章管理对象 article
 * 
 * @author Jm
 * @date 2025-08-12
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Article extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 文章ID */
    private Long id;

    /** 文章标题 */
    @Excel(name = "文章标题")
    private String title;

    /** 文章内容 */
    @Excel(name = "文章内容")
    private String content;

    /** 发布医生ID */
    @Excel(name = "发布医生ID")
    private Long doctorId;

    /** 文章链接 */
    @Excel(name = "文章url")
    private String url;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date time;

    /** 阅读量 */
    @Excel(name = "阅读量")
    private Long readCount;

    @Excel(name = "收藏量")
    private Long collectCount;

    /** 点赞量 */
    @Excel(name = "点赞量")
    private Long approve;

    /** 关联话题ID */
    @Excel(name = "关联话题ID")
    private Long topicId;

    /** 删除标记：0未删除，1已删除 */
    private Integer del;

    /**
    文章表与医生表为一对一关系（以文章作为基表）
    */
    private Doctor doctor;

    private Topic topic;

    /** 定义医院名、科室名（因为只需要用表的一个字段，所以不用写两边的实体类类型避免查询过深） */

    private String hospitalName;

    private String departmentName;

    private Long followDoctor;

}